package com.neusoft.neu24.nep.interceptor;

import com.neusoft.neu24.nep.entity.CommonResult;
import com.neusoft.neu24.nep.entity.HttpCodeEnum;
import lombok.extern.slf4j.Slf4j;

import org.springframework.web.bind.annotation.*;


@RestControllerAdvice
@ResponseBody
@Slf4j
public class GlobalExceptionHandler {


    /**
     *
     * 通用异常处理(用于处理不可预知的异常)
     */
    @ExceptionHandler(Exception.class)
    public CommonResult  exceptionHandler(Exception ex) {
        log.error(ex.getMessage());
        return CommonResult.filure(HttpCodeEnum.SYSTEM_ERROR);
    }
}